// friend_database.h
#ifndef FRIEND_DATABASE_H
#define FRIEND_DATABASE_H

#include <QObject>
#include <QSqlQuery>
#include <QString>
#include "database_connection.h"
#include "user.h"

class FriendDatabase : public QObject {
    Q_OBJECT
public:
    explicit FriendDatabase(DatabaseConnection *dbConnection, QObject *parent = nullptr);

    // 添加好友
    bool addFriend(int userId1, int userId2);
    // 删除好友
    bool removeFriend(int userId1, int userId2);
    // 获取好友列表
    QList<int> getFriendList(int userId);

    QList<QJsonObject> getFriendsList(int userId);

private:
    DatabaseConnection *dbConnection;
};

#endif // FRIEND_DATABASE_H
